<template>
  <div>
    <el-dialog
      v-model="dialogVisible"
      title="关注公众号绑定"
      width="350px"
      @close="closeDialog"
    >
      <el-image :src="qrcode" style="width: 100%; height: 100%" />
    </el-dialog>
  </div>
</template>
<script setup lang="ts">
import { computed } from "vue";
import { getAssetURL } from "@/utils/load_assets";
import useSystemStore from "@/store/main/system/system";
const systemStore = useSystemStore();

const baseURL = import.meta.env.VITE_BASE_URL;
const qrcode = systemStore.publicQrcode
  ? baseURL + systemStore.publicQrcode
  : getAssetURL("common/logo3.png");

const props = defineProps({
  // 是否显示
  show: {
    type: Boolean,
    default: false,
  },
});
const emits = defineEmits(["update:show"]);
const dialogVisible = computed(() => props.show); // 控制弹窗显示

// 关闭弹窗
const closeDialog = () => {
  emits("update:show", false);
};
</script>
<style lang="less" scoped></style>
